package com.xuxk.project.library.service.impl;
import java.util.HashMap;
import java.util.List;
import com.github.pagehelper.Page;
import org.apache.ibatis.session.RowBounds;
import java.util.Map;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.xuxk.project.library.dao.XuxkLibraryDao;
import com.xuxk.project.library.bean.XuxkLibrary;
import com.xuxk.project.library.dto.XuxkLibraryDto;
import com.xuxk.project.library.vo.XuxkLibraryVo;
import com.xuxk.project.library.service.XuxkLibraryService;


/**
 * Manager implementation for XuxkLibrary, responsible for business processing, and communicate between web and persistence layer.
 * @author 橙云科技有限公司
 */
@Service
public class XuxkLibraryServiceImpl implements XuxkLibraryService {

	@Resource
	private XuxkLibraryDao xuxkLibraryDao;
    @Override
	public Page<XuxkLibraryVo>  listXuxkLibrarys(Map<String, Object> map, RowBounds rowBounds){


        Page<XuxkLibraryVo> xuxkLibraryPage =  xuxkLibraryDao.listXuxkLibrarys(map,rowBounds);
		return xuxkLibraryPage;
	}
    @Override
	public List<XuxkLibrary> listXuxkLibraryByDto(XuxkLibraryDto dto){


		return xuxkLibraryDao.listByDto(dto);
	}

    @Override
	public void deleteXuxkLibrary(Integer id )  {
	    Map<String,Object> map = new HashMap<>();
        map.put("id",id);

		xuxkLibraryDao.deleteByPrimaryKey(map);
	}

    /**
    * 全量更新
    * @return
    */
    @Override
    public Integer updateXuxkLibrary(XuxkLibrary xuxkLibrary)  {



        return xuxkLibraryDao.updateXuxkLibrary(xuxkLibrary);
    }

    /**
    * 部分更新
	* @return
	*/
    @Override
    public Integer patchUpdateXuxkLibrary(XuxkLibrary xuxkLibrary)  {


        return xuxkLibraryDao.patchUpdateXuxkLibrary(xuxkLibrary);

    }

    /**
    * 新增
	* @return
	*/
    @Override
    public Integer insertXuxkLibrary(XuxkLibrary xuxkLibrary)  {


		xuxkLibraryDao.insertSelective(xuxkLibrary);

        return xuxkLibrary.getId();

    }
    @Override
    public XuxkLibrary getXuxkLibrary(Integer id,String enterpriseCode){
        Map<String,Object> map = new HashMap<>();
        map.put("id",id);
        return xuxkLibraryDao.getXuxkLibrary(map);
    }

}